package com.me.study.javaCore.classLoader.classLoadingSeq1.test2;

/**
 * 测试类加载顺序: 先静后(动 + 构造)，然后每组内先父后子；同域代码（静态域、非静态域）逐条按顺序执行
 *      <blockquote>
 *      [TestClassLoader] static block<p>
 *      [Person]          static<p>
 *      [ClassB]      static Member variables1: person1<p>
 *      [ClassB]      static code block<p>
 *      [ClassB]      static Member variables2: person2<p>
 *      [TestClassLoader] Member variables1: person1<p>
 *      [TestClassLoader] block<p>
 *      [TestClassLoader] Member variables1: person2<p>
 *      [TestClassLoader] constructor<p>
 *      [ClassB]      Member variables: person<p>
 *      [ClassB]      constructor</blockquote>
 *
 * @author ME
 * @date   2019/4/27
 */
public class TestParentClass {

    private Person person1 = new Person("[TestClassLoader] Member variables1: person1");

    {
        System.out.println("[TestClassLoader] block");
    }

    private Person person2 = new Person("[TestClassLoader] Member variables1: person2");

    static {
        System.out.println("[TestClassLoader] static block");
    }

    public TestParentClass() {
        System.out.println("[TestClassLoader] constructor");
    }

    public static void main(String[] args) {
        new ChildClass();
    }


}
